<% layout('/layouts/default.html', {title: '车辆日志信息', libs: ['dataGrid']}){ %>
<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-title">
                <i class="fa icon-notebook"></i> ${text('车辆日志信息')}
            </div>
        </div>
        <div class="box-body">
            <#form:form id="searchForm" model="${carLog}" action="${ctx}/car/car/carLogListData" method="post" class="form-inline"
            data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
            <div class="form-group">
                <label class="control-label">${text('操作者')}：</label>
                <div class="control-inline">
                    <#form:input path="userName" maxlength="64" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('车辆名称')}：</label>
                <div class="control-inline">
                    <#form:input path="carTitle" maxlength="64" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('品牌')}：</label>
                <div class="control-inline">
                    <#form:input path="brand" maxlength="64" class="form-control width-120"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">${text('操作类型')}：</label>
                <div class="control-inline width-120">
                    <#form:select path="operateType" dictType="h_operate_type" blankOptionLabel="全部" blankOption="true" class="form-control isQuick"/>
                </div>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-primary btn-sm"><i class="glyphicon glyphicon-search"></i> ${text('查询')}</button>
                <button type="reset" class="btn btn-default btn-sm isQuick"><i class="glyphicon glyphicon-repeat"></i> ${text('重置')}</button>
            </div>
        </#form:form>
        <table id="dataGrid"></table>
        <div id="dataGridPage"></div>
    </div>
</div>
</div>
<% } %>
<script>
    //# // 初始化DataGrid对象
    $('#dataGrid').dataGrid({
        searchForm: $("#searchForm"),
        emptyDataHint: true,
        columnModel: [
            {header:'${text("操作者")}', name:'userName', index:'u.user_name', width:150, align:"center"},
            {header:'${text("车辆名称")}', name:'carTitle', index:'a.car_title', width:150, align:"center"},
            {header:'${text("品牌")}', name:'brand', width:150, align:"center"},
            {header:'${text("车型")}', name:'carModel', index:'a.car_model', width:150, align:"center"},
            {header:'${text("车身颜色")}', name:'carColor', index:'a.car_color', width:150, align:"center"},
            {header:'${text("原价")}', name:'originalPrice', index:'a.original_price', width:150, align:"center", formatter: function(val, obj, row, act){
                    return '<span class="text-red">'+js.formatMoney(val/100, 2)+' 元</span>';
                }},
            {header:'${text("售价")}', name:'sellPrice', index:'a.sell_price', width:150, align:"center", formatter: function(val, obj, row, act){
                    return '<span class="text-red">'+js.formatMoney(val/100, 2)+' 元</span>';
                }},
            {header:'${text("操作类型")}', name:'operateType', index:'a.operate_type', width:150, align:"center", formatter: function(val, obj, row, act){
                    return js.getDictLabel("#{@DictUtils.getDictListJson('h_operate_type')}", val, '${text("未知")}', true);
                }},
            {header:'${text("操作时间")}', name:'createDate', index:'a.create_date', width:180, align:"center"},
        ],
        //# // 加载成功后执行事件
        ajaxSuccess: function(data){

        }
    });
</script>